package mailserver.main;

import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import mailserver.server.Server;

public class Main {

    public static void main(String[] args) throws IOException 
             {
        Server server = new Server();
        while (true) {
            try {
                server.run();
            } catch (Exception ex) {
                Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
                server.close();
                System.out.println("server stopped");
                server = new Server();
            }
        }
    }
}
